#ifndef BOARD_H
#define BOARD_H

#include "raylib.h"
#include "ConfigManager.h"
#include <string>

// Board基类
class Board {
public:
    Board(float x, float y, const GameConfig& gameConfig);
    virtual ~Board() = default;
    
    // 虚函数实现
    virtual void Update();
    virtual void Draw();
    virtual void OnPlayerLand();
    virtual void Reset(float x, float y);
    virtual bool IsBreakable() const;
    virtual void SetType(const std::string& type); // 添加设置类型的方法
    
    // 默认碰撞检测实现
    virtual bool CheckCollision(Rectangle playerRect);
    
    // 获取矩形区域
    Rectangle GetRect() const;
    
    // Getter和Setter
    Vector2 GetPosition() const { return position; }
    void SetPosition(float x, float y) { position.x = x; position.y = y; }
    bool IsActive() const { return active; }
    void SetActive(bool isActive) { active = isActive; }
    const GameConfig& GetConfig() const { return config; }
    const std::string& GetType() const { return type; }
    
protected:
    Vector2 position;
    bool active;
    Color color;
    const GameConfig& config;
    bool isCracked;      // 是否破裂
    float crackTimer;    // 破裂计时器
    std::string type;    // 板子类型
};

#endif // BOARD_H